package com.boot.ys.mybatisplus.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author Yang Sheng
 * @since 2022-02-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Easyexcel对象", description="")
public class Easyexcel implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelIgnore // 生成报表时忽略，不生字段
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelProperty(value = "姓名", index = 0) // 定义表头名称和位置,0代表第一列
    @ApiModelProperty(value = "姓名")
    private String name;

    @ExcelProperty(value = "年龄", index = 1)
    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ExcelProperty(value = "出生日期", index = 2)
    @ColumnWidth(20) // 定义列宽
    @DateTimeFormat(value = "yyyy/MM/dd")
    @ApiModelProperty(value = "出生日期")
    private Date birthday;


}
